﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Palsta.Core.data;

namespace Palsta.Core.function
{
    class Xslt_string_length : XsltFunction
    {
        public FieldType GetReturnType()
        {
            return FieldType.Integer;
        }

        public Field Execute(Field[] args)
        {
            if (args.Length != 1) return null;
            if (args[0].GetFieldType() != FieldType.String)
            {
                new IntegerField(0);
            }
            String s0 = args[0].GetStringValue();
            IntegerField f = new IntegerField(s0.Length);
            return f;
        }
    }
}
